package org.holdren.testspringmvc.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;

import org.codehaus.jackson.annotate.JsonValue;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Person
{
	private long id;
	
	private String firstName;
    
	private String lastName;
	
	private int age;
	
	private Sex sex;
	
	public enum Sex
	{
		@XmlEnumValue("male")
		MALE("male"),
		
		@XmlEnumValue("female")
		FEMALE("female");
		
		private String value;

		@JsonValue
		public String getValue()
		{
			return value;
		}

		private Sex(String value)
		{
			this.value = value;
		}
		
	}

	public String getFirstName()
	{
		return firstName;
	}

	public void setFirstName(String firstName)
	{
		this.firstName = firstName;
	}

	public String getLastName()
	{
		return lastName;
	}

	public void setLastName(String lastName)
	{
		this.lastName = lastName;
	}

	public int getAge()
	{
		return age;
	}

	public void setAge(int age)
	{
		this.age = age;
	}

	public Sex getSex()
	{
		return sex;
	}

	public void setSex(Sex sex)
	{
		this.sex = sex;
	}

	public long getId()
	{
		return id;
	}

	public void setId(long id)
	{
		this.id = id;
	}
	
}
